class StepsController < ApplicationController
  layout 'steps'
  
  before_filter :set_active_step
  before_filter :check_already_created_user
  
  def index
    redirect_to step_one_steps_url
  end
  
  def step_one
    @matches = Match.all_by_serie
  end  
  
  def step_two
    fql = "SELECT uid, name, pic_square FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = #{@user.fb_id})"
    @friends = facebook_session.fql_query(fql)
  end
  
  def step_three
  end
  
  protected
  def set_active_step
    @active = action_name    
  end
  
  def check_already_created_user
    #TODO descomentar si no está en modo desarrollo
    #redirect_to root_url unless @user.is_new_user
  end
  
end
